# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=libgtop
pkgver=2.41.2
pkgrel=1
pkgdesc='Library for collecting system monitoring data'
arch=('loong64' 'x86_64')
url='https://gitlab.gnome.org/GNOME/libgtop'
license=('GPL')
depends=('glib2' 'glibc' 'libxau')
makedepends=('gobject-introspection' 'gtk-doc')
source=("https://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz")
sha256sums=('d9026cd8a48d27cdffd332f8d60a92764b56424e522c420cd13a01f40daf92c3')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib/$pkgname --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
